You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, implement caching for extensive arrow calculations. If the calculation for an arrow remains unchanged from the previous one, reuse the previous result. This significantly reduces computation. For example, __noteAngle previously required a separate calculation for each arrow. After this change, if all arrows in the list are the same, it will only be calculated once.
Remove abs from scrollSpeed. Since there's no need to ensure correctness during runtime, if users find errors related to this, they can correct them in their own large codebases. Some may even intentionally want that "incorrect" effect.
Remove the setter in the calculations within updateSustainClip and set_clipRect, keeping only the values that are actually needed from the original setter.
Finally, removed the unused static variable __notePosFrameOffset. Changed the static variable __posPoint to a local variable, making the code cleaner and improving performance.
Another optimization was also added: the per-frame operation for __cachedCopyFields has been improved. A condition check is now added — if __cachedCopyFields has no values, the operation will be skipped. If it does need to run, the execution method has also been optimized.
Okay, fixed a previous issue with the code implementation.
Originally, the code directly restored the position within isOnScreen, causing incorrect positioning during rendering. I added two new external variables to cache this operation and restored it in drawComplex. Since isOnScreen was modified, I created a new isOnScreenOriginal method to replace the original public method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First, move the
downscrollCamposition calculation before theisOnScreencheck to prevent culling errors.Simplify the bloated
downscrollCamcalculation:These are actually equivalent.
Additionally, implement caching for extensive arrow calculations. If the calculation for an arrow remains unchanged from the previous one, reuse the previous result. This significantly reduces computation. For example,
__noteAnglepreviously required a separate calculation for each arrow. After this change, if all arrows in the list are the same, it will only be calculated once.Remove
absfromscrollSpeed. Since there's no need to ensure correctness during runtime, if users find errors related to this, they can correct them in their own large codebases. Some may even intentionally want that "incorrect" effect.Remove the setter in the calculations within
updateSustainClipandset_clipRect, keeping only the values that are actually needed from the original setter.Finally, removed the unused static variable
__notePosFrameOffset. Changed the static variable__posPointto a local variable, making the code cleaner and improving performance.